package com.gui.hosp.controller;

import com.gui.common.result.Result;
import com.gui.hosp.service.DepartmentService;
import com.gui.model.hosp.Department;
import com.gui.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author GodLamp
 * @date 2022/10/22 18:40
 */
@RestController
@RequestMapping(path = "/admin/hosp/department")
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    /**
     * 根据医院编号，查询该医院的所有科室
     * @param hoscode
     * @return
     */
    @ApiOperation(value = "根据医院编号，查询该医院的所有科室")
    @GetMapping(path = "getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable(name = "hoscode") String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);

        return Result.ok(list);
    }
}
